package fudan.se.project.service.infrastructure.entity.conference.role;

import fudan.se.project.domain.conference.role.Chair;
import fudan.se.project.repository.entity.conference.role.ChairRepository;
import fudan.se.project.service.infrastructure.base.IEntityService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Collection;

@Service
@Slf4j
public class ChairService implements IEntityService<Chair> {


    private final ChairRepository chairRepository;

    public ChairService(ChairRepository chairRepository) {
        this.chairRepository = chairRepository;
    }

    @Override
    public Chair findById(long id) {
        return chairRepository.findById(id);
    }

    @Override
    public Chair save(Chair chair) {
        return chairRepository.save(chair);
    }

    @Override
    public Iterable<Chair> saveAll(Collection<Chair> chairs) {
        return chairRepository.saveAll(chairs);
    }
}
